<?php if ($all_rows > 0) : ?>
    <table class="table">
        <tbody>
        <?php $month = ''; ?>
        <?php foreach($rebateRecord->result() as $key=>$value) : ?>
            <tr>
                <td class="time-month">
                    <?php if ($value->month != $month) : ?>
                        <div class="user-month">
                            <?php $month = $value->month; ?>
                            <h6><?php echo strstr($month, '-', TRUE); ?></h6>
                            <p><?php echo ltrim(strstr($month, '-'), '-'); ?></p>
                        </div>
                    <?php endif; ?>
                </td>
                <td class="time-id">
                    <h6>返利单号</h6>
                    <p><?php echo $value->id; ?></p>
                </td>
                <td class="time-price">
                    <h6>申请金额</h6>
                    <p><?php echo $value->o_income; ?></p>
                </td>
                <td class="time-price">
                    <h6>抵扣金额</h6>
                    <p><?php echo $value->deduction; ?></p>
                </td>
                <td class="time-price">
                    <h6>实际金额</h6>
                    <p><?php echo $value->r_income; ?></p>
                </td>
                <td class="time-price">
                    <h6>申请状态</h6>
                    <p>
                     <?php
                        switch (intval($value->flag)) {
                            case 1:
                                echo "申请中";
                                break;
                            case 2:
                                echo "申请成功";
                                break;
                            case 4:
                                echo "申请失败";
                                break;
                        }
                    ?>
                </p>
                </td>
                <td class="time-date">
                    <h6>申请时间</h6>
                    <p><?php echo date('Y-m-d H:i:s', $value->date); ?></p>
                </td>
            </tr>
        <?php endforeach; ?>
        </tbody>
    </table>
    <?php $this->load->view('layout/pagination'); ?>
<?php else: ?>
    <div class="no-data">
        <img src="ucenter/images/panda.jpg"/>
        <p>没有搜索到结果</p>
    </div>
<?php endif; ?>